﻿#!/usr/bin/env python
# -*- coding:utf-8 -*-

'a socket example which sends echo message to server'

__author__='zhaoxp'

import socket

if __name__=='__main__':
	s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
	s.connect(('127.0.0.1',9090))
	print 'connecting ...'
	print s.recv(1024)
	
	for data in ['Michael','Tracy','Sarah']:
		s.send(data)
		print 'from '+data+' \n'+s.recv(1024)
	s.send('exit')
	print '-----end-----'